using SharpGraphT.Graph.Builder;
using SharpGraphT.Util;

namespace SharpGraphT.Graph;

public class Pseudograph<TV, TE> : AbstractBaseGraph<TV, TE>
    where TE : class, new() {
    private static readonly long SerialVersionUid = -7574564204896552581L;

    public Pseudograph() :
        this(null, SupplierUtil.CreateSupplier<TE>(), false) { }

    public Pseudograph(Func<TV> vertexSupplier, Func<TE> edgeSupplier,
        bool weighted) : base(vertexSupplier, edgeSupplier,
        new DefaultGraphType.Builder().Undirected().AllowMultipleEdges(true)
            .AllowSelfLoops(true).Weighted(weighted).Build()) { }

    public static GraphBuilder<TV, TE, Pseudograph<TV, TE>>
        CreateBuilder() =>
        new(new Pseudograph<TV, TE>());

    public static GraphBuilder<TV, TE, Pseudograph<TV, TE>>
        CreateBuilder(Func<TE> edgeSupplier) =>
        new(new Pseudograph<TV, TE>(null, edgeSupplier, false));
}